﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
using System.Reflection;

namespace DaphneTranslatorWPF
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            ApplyTheme();
            base.OnStartup(e);
        }

        public ResourceDictionary GetThemeResourceDictionary()
        {
            Assembly assembly = Assembly.GetExecutingAssembly();
            string packUri = String.Format(@"/Theme/Theme.xaml");
            return Application.LoadComponent(new Uri(packUri, UriKind.Relative)) as ResourceDictionary;
        }

        public void ApplyTheme()
        {
            ResourceDictionary dictionary = GetThemeResourceDictionary();

            if (dictionary != null)
            {
                this.Resources.MergedDictionaries.Clear();
                this.Resources.MergedDictionaries.Add(dictionary);
            }
        }




    }


}
